Skip to content

test: cover trailing cert bytes cache poisoning guard#38

Open
leanthebean wants to merge 1 commit into
base:mainfrom
leanthebean:security/reject-trailing-cert-bytes
Open

test: cover trailing cert bytes cache poisoning guard#38
leanthebean wants to merge 1 commit into
base:mainfrom
leanthebean:security/reject-trailing-cert-bytes

Conversation

@leanthebean

@leanthebean leanthebean commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add explicit regression coverage for CAT finding a2394309-60a7-435e-ab5b-d66efa0364e4.
  • Exercise the reported attack sequence: append trailing bytes to the AWS Nitro root cert, compute valid public P-384 hints, attempt to cache the shadow root, then attempt to verify the genuine child CA under that shadow parent.
  • Assert the shadow root is not cached and the child cannot be pinned to the attacker-controlled parent hash.

Security

Latest main already blocks this vector before the verifiedParent write: _verifyUncachedCert requires the outer DER object to consume the full submitted buffer, and _verifyCertSignatureWithHints rejects trailing fields inside the certificate sequence.

This PR locks that behavior with a focused regression test for the exact poisoning path.

Tests

  • forge test --match-test test_HintedTrailingRootBytesCannotPoisonParentCache -vvv
  • forge test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant